/**
 * Created by JinMiao
 * 2017/7/10.
 */
fun main(args: Array<String>) {
    for (i in 1..100)
        test(false)
    test(true)
}

fun test(print:Boolean){

    var run:Runnable = Runnable {

        Thread() }
    run.run();

    var start = System.currentTimeMillis()
    for( i in 1..10000000){
        var java=JavaCallKotlin()
        java.a=55
    }
    if (print)
        println(System.currentTimeMillis()-start)
    start = System.currentTimeMillis()
    for( i in 1..10000000){
        var java=KotlinCallJava()
        java.a=55
    }
    if(print)
        println(System.currentTimeMillis()-start)

}



class KotlinCallJava(){
    var a: Int = 0

    fun aa(){
        var run:Runnable = Runnable {

            Thread() }
        run.run();


    }


}